console.log("inject.js",chrome)
document.addEventListener("keydown", e => {
  if (e.altKey && e.key == 'c') {
    let word = window.getSelection().toString().trim();
    if(word){
      // console.log(word,"ttt");
      // translate(word)
      window.postMessage({"translate": word}, '*');
    }
  } else if (e.altKey && e.key == 'o') {
  }
})

function translate(e){
/*   $.ajax({
      url:'http://fanyi.youdao.com/translate',
      method:'get',
      data:{
          type:'auto',
          i:e
      },
      dataType:'json',
      success(res){
        console.log(res,222)
      }
  }) */

 
}


